package com.code;

import java.util.ArrayList;
import java.util.List;

public class ActionDefinition{
	private Integer actionCode;
    private String actionName;
    private String className;
    private String fileName;
    public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	private boolean systemed;
    private String notes;
    private String iconFile;
    private boolean node;
    private boolean initial;
    private boolean autoRun;

    public Integer getActionCode() {
		return actionCode;
	}
	public void setActionCode(Integer actionCode) {
		this.actionCode = actionCode;
	}
	public boolean isAutoRun() {
		return autoRun;
	}
	public void setAutoRun(boolean autoRun) {
		this.autoRun = autoRun;
	}
	private String ptype;
	private List<ActionDefinition> childActions;
	protected List<PropertyPower> propertyPowers=new ArrayList<PropertyPower>();
    private String buttons;
	private String defaultButtons;
	public String getActionName() {
		return actionName;
	}
	public void setActionName(String actionName) {
		this.actionName = actionName;
	}

	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	public String getIconFile() {
		return iconFile;
	}
	public void setIconFile(String iconFile) {
		this.iconFile = iconFile;
	}
	public boolean isInitial() {
		return initial;
	}
	
	public boolean isNode() {
		return node;
	}
	public void setNode(boolean node) {
		this.node = node;
	}
	public void setInitial(boolean initial) {
		this.initial = initial;
	}
	public List<ActionDefinition> getChildActions() {
		return childActions;
	}
	public void setChildActions(List<ActionDefinition> childActions) {
		this.childActions = childActions;
	}
	public boolean isSystemed() {
		return systemed;
	}
	public void setSystemed(boolean systemed) {
		this.systemed = systemed;
	}
	public String getNotes() {
		return notes;
	}
	public void setNotes(String notes) {
		this.notes = notes;
	}

	@Override
	public int hashCode() {
		return actionName.hashCode();
	}
	@Override
	public boolean equals(Object obj) {
		if (!ActionDefinition.class.isInstance(obj)) return false;
		return ((ActionDefinition)obj).actionName.equals(actionName);
	}
	@Override
	public String toString() {
		return actionName;
	}
	public String getButtons() {
		return buttons;
	}
	public void setButtons(String buttons) {
		this.buttons = buttons;
	}
	public String getDefaultButtons() {
		return defaultButtons;
	}
	public void setDefaultButtons(String defaultButtons) {
		this.defaultButtons = defaultButtons;
	}
    public boolean forAction(String actionName){
    	return this.actionName.equals(actionName);
    }
    public List<PropertyPower> propertyPowers() {
		return propertyPowers;
	}

	public void setPropertyPowers(List<PropertyPower> propertyPowers) {
		this.propertyPowers = propertyPowers;
	}
	public String getPtype() {
		return ptype;
	}
	public void setPtype(String ptype) {
		this.ptype = ptype;
	}
	public boolean forPtype(String ptype){
    	return this.ptype.equals(ptype);
    }

}
